GetBankPTR
Address = GetBankPTR(BankIndex)
 
Parameters:

    BankIndex = The Index of the bank your wish to query
Returns:

    Address = The Address of this bank in memory
 

     GetBankPTR returns the address in memory (the pointer) of a memory bank.

     This is often useful when using DLL's or using the ReadMemory/WriteMemory functions for faster file accesss.




FACTS:


      * The return address will be invalid if the bank is deleted after reading the initial pointer value.

      * After a ResizeBank the pointer of a bank may be different between calls. Therefore it's recommended you always query to the pointer prior to perform any write operation to avoid potenial logic issues.




Mini Tutorial:


This code creates a bank and returns the banks actually memory pointer.
  
; Create Memory Bank #1 and make it 1000 bytes in size
  CreateBank 1,1000
  
; Display the status of this bank
  Print "Bank Satus:"+Str$(GetBankStatus(1))
  Print "Bank Size:"+Str$(GetBankSize(1))
  Print "Bank Pointer:"+Str$(GetBankPtr(1))
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output something like this (the memory banks pointer value will differ each time the demo is run)

  
  Bank Satus:1
  Bank Size:1000
  Bank Pointer:6126323
  

 
Related Info: CreateBank | Dim | GetBankSize | GetBankStatus | Pointer :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com